package com.jxk.test.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @ClassName : MyHttpSessionListener  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-21 13:47  //时间
 */
@WebListener
public class MyHttpSessionListener implements HttpSessionListener {
    public static int online;
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        System.out.println("创建session");
        online ++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("销毁session");

    }
}
